<template>
  <view v-if="show" @click="handleClick">
    <view class="mark"></view>
    <img class="openImg" :src="openImg" alt="" />
    <view class="wx_text">
      <view>点击右上角</view>
      <view>分享给您的好友</view>
    </view>
  </view>
</template>

<script>
  // import router from '@/router'
  // import * as auth from '@/utils/auth.js'
  import { OPEN_SHARE } from '@/model/imgConst'
  // import { getShareUrl } from './tools'
  // import {
  //   updateAppMessageShareData,
  //   updateTimelineShareData
  // } from '@/utils/sdk/index.js'
  export default {
    name: 'ShareMark',
    data() {
      return {
        openImg: OPEN_SHARE
        // options: {},
        // finishPath: ''
      }
    },
    props: {
      show: {
        type: Boolean
      }
    },
    methods: {
      handleClick() {
        this.$emit('close')
        // this.show = false
        // this.finishPath && router.replace(this.finishPath)
      }

      // handelShare(options) {
      //   const o = getShareUrl(options)
      //   this.options = o
      //   console.log(this.options)
      //   return Promise.all([this.handleShareFriend(), this.handleShareGroup()])
      // },

      // handleShareFriend() {
      //   return updateAppMessageShareData(this.options).then((res) => {
      //     console.log('分享成功', res)
      //     return res
      //   })
      // },

      // handleShareGroup() {
      //   return updateTimelineShareData(this.options).then((res) => {
      //     console.log('分享成功', res)
      //     return res
      //   })
      // }
    }
  }
</script>
<style lang="scss" scoped>
  .mark {
    height: 100%;
    width: 100%;
    z-index: 999;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    opacity: 0.6;
  }
  .openImg {
    height: 360rpx;
    width: 210rpx;
    z-index: 1000;
    right: 50rpx;
    position: fixed;
    top: 40rpx;
  }
  .wx_text {
    z-index: 1000;
    text-align: center;
    width: 100%;
    position: fixed;
    top: 400rpx;
    left: 50%;
    transform: translate(-50%, 0%);
    text-align: center;
    width: 477rpx;
    height: 138rpx;
    border: 1px dotted #fff;
    padding-top: 20rpx;
    box-sizing: border-box;
    border-radius: 50%;

    color: #fff;
    font-size: 34rpx;
  }
</style>
